﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace TelecoSystems.Infrastructure.Views
{
    public partial class InformationWindow : ChildWindow
    {
        protected InformationWindow(string title, string message)
        {
            InitializeComponent();

            if (title != "") this.Title = title;
            this.Message.Text = message;
        }

        #region Factory Shortcut Methods
        public static void Create(string message)
        {
            Create("", message);
        }
        #endregion

        #region Factory methods
        public static void Create(string message, string title)
        {
            if (Application.Current.IsRunningOutOfBrowser) {
                NotificationWindow win = new NotificationWindow();
                NotificationToast toast = new NotificationToast();
                toast.Caption.Text = title; 
                toast.Message.Text = message;
                win.Content = toast;
                win.Width = 200;
                win.Height = 100;
                win.Show(500);  
            } else {
                InformationWindow win = new InformationWindow(title, message);
                win.Show();
            }
        }
        #endregion

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }
    }
}

